package Jogo;
	/*
[00]	[01]	[02]	[03]	[04]	[05]	[06]	[07]	[08]	[09]	[010]	[011]	[012]	[013]
[10]	[11]	[12]	[[13]	[14]	[15]	[16]	[17]	[18]	[19]	[110]]	[111]	[112]	[113]
[20]	[21]	[[22]	[[23]	[24]	[25]	[26]	[27]	[28]	[29]	[210]]	[211]]	[212]	[213]
[30]	[[31]	[[32]	[[33]	[34]	[35]	[36]	[37]	[38]	[39]	[310]]	[311]]	[312]]	[313]
[40]	[[41]	[[42]	[[43]	[44]	[45]	[46]	[47]	[48]	[49]	[410]]	[411]]	[412]]	[413]
[50]	[[51]	[[52]	[[53]	[54]	[55]	[56]	[57]	[58]	[59]	[510]]	[511]]	[512]]	[513]
[60]	[61]	[[62]	[[63]	[64]	[65]	[66]	[67]	[68]	[69]	[610]]	[611]]	[612]	[613]
[70]	[71]	[72]	[[73]	[74]	[75]	[76]	[77]	[78]	[79]	[710]]	[711]	[712]	[713]
[80]	[81]	[82]	[83]	[84]	[85]	[86]	[87]	[88]	[89]	[810]	[811]	[812]	[813]

^
|  Y

X ->

	 */


public class Board {
	int sizeBoardX=14 ,sizeBoardY=9;
	boolean spot[][]=new boolean[sizeBoardX][sizeBoardY]; 
	//int col, lin;
	//boolean scoringZone, safetyZone;
	

	public Board() {
		//sizeBoardX = sizeX;
		//sizeBoardY = sizeY;

	/*	put pieces (true) on initial board arrangement 
	 	*1 every scoring space
		*1 every safetyzone space : 
			*3 Large
			*5 Medium
			*7 Small
	*/
		
		for (int i = 0; i < sizeBoardX; i++) {
			for (int j = 0; j < sizeBoardY; j++) {
				spot[i][j]=true;
			}
		}
		
	}
	
	public void setSpotBoard(int fromX, int fromY, int toX, int toY){
		spot[fromX][fromY]=false;
		spot[toX][toY]=true;
	}
	
	private boolean safetyZone(int lin, int col){
		boolean safetyZone= false;
		int i;//,j;
	
		if(col!=1 && col!=2 && col!=3 && col!=sizeBoardX-2 && col!=sizeBoardX-3 && col!=sizeBoardX-4){
			safetyZone=false;
		}
		else {
			if (col==1 || col== sizeBoardX-2){
				for (i=3;i>2 && i<6;i++){
					if(lin!=i){
						safetyZone=false;
					}else{
						safetyZone=true;
						return  safetyZone;
					}
				}
			}
			else{
				if (col==2 || col== sizeBoardX-3){
					for (i=2;i>1 && i<7;i++){
						if(lin!=i){
							safetyZone=false;
						}else{
							safetyZone=true;
							return  safetyZone;
						}
					}
				}
				else{
					if (col==3 || col== sizeBoardX-4){
						for (i=1;i>0 && i<8;i++){
							if(lin!=i){
								safetyZone=false;
							}else{
								safetyZone=true;
								return  safetyZone;
							}
						}
					}
				}
			}
		}
		
		
		return  safetyZone;
	}
	
	private boolean scoringZone(int lin, int col){
		//first and last column
		boolean scoringZone=false;
		
		if (col == 0 || col == sizeBoardX-1){
			scoringZone=true;
		}
		else scoringZone=false;
		
		return scoringZone;
	}
	
	public String getZone(int lin, int col){
		if(scoringZone(lin,col)){
			return "ScoringZone";
		}else{
			if(safetyZone(lin, col)){
				return "SafetyZone";
			}
			else return "RegularZone";
		}
			
	}
	
}
